package com.bookstore.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bookstore.entity.vo.NameValueVO;
import com.bookstore.entity.vo.OrderManageVO;
import com.bookstore.entity.vo.OrderVo;
import com.bookstore.entity.vo.TodayVolumVO;
import com.bookstore.mapper.OrderMapper;
import com.bookstore.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImpl extends ServiceImpl<OrderMapper, com.bookstore.entity.po.OrderPO> implements OrderService {

    @Autowired
    OrderMapper orderMapper;

    @Override
    public List<OrderVo> getUnsignedOrder(String username) {
       return orderMapper.getUnsignedOrder(username,OrderService.NOT_SHIPPED,OrderService._SHIPPED);
    }

    @Override
    public List<OrderVo> getSignedOrder(String userName) {
        return orderMapper.getUnsignedOrder(userName,OrderService.SINGED,OrderService.CANCEL);
    }

    @Override
    public List<TodayVolumVO> getTodayVolume() {
       return orderMapper.getTodayVolume();
    }

    @Override
    public List<NameValueVO> getClassVolume() {
       return orderMapper.getClassVolume();
    }

    @Override
    public List<NameValueVO> nearTM() {
        return orderMapper.nearTM();
    }

    @Override
    public List<OrderManageVO> getOrderList(Integer start ,Integer offset) {
        return orderMapper.getOrderList(start,offset);
    }
}
